<template>
  <div>
    <el-button @click="add()" type="danger">添加</el-button>
    <v-add :obj="obj" ref="oCh"></v-add>
    <v-list @update="update"></v-list>
  </div>
</template>

<script>
// import {menuList} from "../../../request/api.js"
import vAdd from "./components/add.vue";
import vList from "./components/list.vue";
export default {
  data() {
    return {
      obj: {
        isTrue: false,
        vAdd: true,
      },
    };
  },
  components: {
    vAdd,
    vList,
  },
  methods: {
    //添加
    add() {
      this.obj.isTrue = true;
      this.obj.vAdd = true;
    },
    //点击了编辑
    update(id) {
      this.obj.isTrue = true;
      this.obj.vAdd = false;
      this.$refs.oCh.getOne(id);
    },
  },
};
</script>

<style>
</style>